Controls a 28BYJ-48 stepper motor via ULN2003 driver IC.
More...
#include <StepperULN2003.h>
|
| | Stepper (int steps, int in1, int in2, int in3, int in4) |
| | Constructor for the Stepper class.
|
| |
| void | setSpeed (unsigned long speed) |
| | Set the motor speed in revolutions per minute (RPM).
|
| |
| void | setStepMode (StepMode mode) |
| | Set the stepping mode (half-step or full-step).
|
| |
| void | step (int steps) |
| | Move the motor a specified number of steps.
|
| |
Controls a 28BYJ-48 stepper motor via ULN2003 driver IC.
This class provides an interface to control a unipolar stepper motor using the ULN2003 driver in either half-step (4) or full-step (8) mode. Step timing is managed internally based on the set speed.
◆ StepMode
Step resolution modes supported by the driver.
| Enumerator |
|---|
| HALF4 | Half-step mode (4 steps per cycle)
|
| FULL8 | Full-step mode (8 steps per cycle)
|
◆ Stepper()
| Stepper::Stepper |
( |
int | steps, |
|
|
int | in1, |
|
|
int | in2, |
|
|
int | in3, |
|
|
int | in4 ) |
Constructor for the Stepper class.
- Parameters
-
| steps | Number of steps required for a full rotation (e.g., 4096). |
| in1 | Pin connected to IN1 of ULN2003. |
| in2 | Pin connected to IN2 of ULN2003. |
| in3 | Pin connected to IN3 of ULN2003. |
| in4 | Pin connected to IN4 of ULN2003. |
◆ setSpeed()
| void Stepper::setSpeed |
( |
unsigned long | speed | ) |
|
Set the motor speed in revolutions per minute (RPM).
- Parameters
-
| speed | Desired speed in RPM (positive values only). |
◆ setStepMode()
| void Stepper::setStepMode |
( |
StepMode | mode | ) |
|
Set the stepping mode (half-step or full-step).
- Parameters
-
◆ step()
| void Stepper::step |
( |
int | steps | ) |
|
Move the motor a specified number of steps.
- Parameters
-
| steps | Number of steps to move. Positive = clockwise, negative = counterclockwise. |
The documentation for this class was generated from the following files: